/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_ACTIONS__
#define __CC_PYTHON_IMPORT_O_ACTIONS__

#include <cocos2d.h>
#include "python_object_nodeobjects.h"

#define CC_ACTION_PYTYPE_MAPPING(pytype)\
	PyTypeObject *GetPythonType(){ return CPyClassBase::GetTypeObject<pytype>(); }

NS_CCPY_BEGIN

	class CPyAction : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyAction)
	public:
		CPyAction();
		PYCLASS_METHOD_DEF(CPyAction, startWithTarget);
		PYCLASS_METHOD_DEF(CPyAction, stop);
		PYCLASS_METHOD_DEF(CPyAction, step);
		PYCLASS_GET_DEF(CPyAction, Done);
		PYCLASS_GETSET_MAPPING_DEF(CPyAction, Target);
		PYCLASS_GETSET_MAPPING_DEF(CPyAction, OriginalTarget);
		CC_ACTION_PYTYPE_MAPPING(CPyAction);
	};
	
	class CPyFiniteTimeAction : public CPyAction
	{
	PYCLASS_DEF_INTERFACE(CPyFiniteTimeAction)
	public:
		CPyFiniteTimeAction();
		PYCLASS_METHOD_DEF(CPyFiniteTimeAction, reverse);
		PYCLASS_GETSET_MAPPING_DEF(CPyFiniteTimeAction, Duration);
		CC_ACTION_PYTYPE_MAPPING(CPyFiniteTimeAction);
	};

	class CPySpeed : public CPyAction
	{
	PYCLASS_DEF_INTERFACE(CPySpeed)
	public:
		CPySpeed();
		PYCLASS_METHOD_DEF(CPySpeed, reverse);
		PYCLASS_METHOD_DEF(CPySpeed, initWithAction);
		PYCLASS_GETSET_MAPPING_DEF(CPySpeed, Speed);
		PYCLASS_GETSET_MAPPING_DEF(CPySpeed, InnerAction);
		CC_ACTION_PYTYPE_MAPPING(CPySpeed);
	};
	
	class CPyFollow : public CPyAction
	{
	PYCLASS_DEF_INTERFACE(CPyFollow)
	public:
		CPyFollow();
		PYCLASS_GETSET_MAPPING_DEF(CPyFollow, BoundarySet);
		PYCLASS_METHOD_DEF(CPyFollow, initWithTarget);
		CC_ACTION_PYTYPE_MAPPING(CPyFollow);
	};
	
	class CPyActionInterval : public CPyFiniteTimeAction
	{
	PYCLASS_DEF_INTERFACE(CPyActionInterval)
	public:
		CPyActionInterval();
		PYCLASS_METHOD_DEF(CPyActionInterval, reverse);
		PYCLASS_GET_DEF(CPyActionInterval, Elapsed);
		PYCLASS_GETSET_MAPPING_DEF(CPyActionInterval, AmplitudeRate);
		PYCLASS_METHOD_DEF(CPyActionInterval, initWithDuration);
		CC_ACTION_PYTYPE_MAPPING(CPyActionInterval);
	};

	class CPySequence : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPySequence)
	public:
		CPySequence();
		CC_ACTION_PYTYPE_MAPPING(CPySequence);
	};

	class CPyRepeat : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyRepeat)
	public:
		CPyRepeat();
		PYCLASS_GETSET_MAPPING_DEF(CPyRepeat, InnerAction);
		CC_ACTION_PYTYPE_MAPPING(CPyRepeat);
	};

	class CPyRepeatForever : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyRepeatForever)
	public:
		CPyRepeatForever();
		PYCLASS_GETSET_MAPPING_DEF(CPyRepeatForever, InnerAction);
		CC_ACTION_PYTYPE_MAPPING(CPyRepeatForever);
	};

	class CPySpawn : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPySpawn)
	public:
		CPySpawn();
		CC_ACTION_PYTYPE_MAPPING(CPySpawn);
	};

	class CPyRotateTo : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyRotateTo)
	public:
		CPyRotateTo();
		CC_ACTION_PYTYPE_MAPPING(CPyRotateTo);
	};

	class CPyRotateBy : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyRotateBy)
	public:
		CPyRotateBy();
		CC_ACTION_PYTYPE_MAPPING(CPyRotateBy);
	};

	class CPyMoveBy : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyMoveBy)
	public:
		CPyMoveBy();
		CC_ACTION_PYTYPE_MAPPING(CPyMoveBy);
	};

	class CPyMoveTo : public CPyMoveBy
	{
	PYCLASS_DEF_INTERFACE(CPyMoveTo)
	public:
		CPyMoveTo();
		CC_ACTION_PYTYPE_MAPPING(CPyMoveTo);
	};
	
	class CPySkewTo : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPySkewTo)
	public:
		CPySkewTo();
		CC_ACTION_PYTYPE_MAPPING(CPySkewTo);
	};

	class CPySkewBy : public CPySkewTo
	{
	PYCLASS_DEF_INTERFACE(CPySkewBy)
	public:
		CPySkewBy();
		CC_ACTION_PYTYPE_MAPPING(CPySkewBy);
	};

	class CPyJumpBy : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyJumpBy)
	public:
		CPyJumpBy();
		CC_ACTION_PYTYPE_MAPPING(CPyJumpBy);
	};
	
	class CPyJumpTo : public CPyJumpBy
	{
	PYCLASS_DEF_INTERFACE(CPyJumpTo)
	public:
		CPyJumpTo();
		CC_ACTION_PYTYPE_MAPPING(CPyJumpTo);
	};
	

	class CPyBezierBy : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyBezierBy)
	public:
		CPyBezierBy();
		CC_ACTION_PYTYPE_MAPPING(CPyBezierBy);
	};
	
	class CPyBezierTo : public CPyBezierBy
	{
	PYCLASS_DEF_INTERFACE(CPyBezierTo)
	public:
		CPyBezierTo();
		CC_ACTION_PYTYPE_MAPPING(CPyBezierTo);
	};
	
	class CPyScaleTo : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyScaleTo)
	public:
		CPyScaleTo();
		CC_ACTION_PYTYPE_MAPPING(CPyScaleTo);
	};
	
	class CPyScaleBy : public CPyScaleTo
	{
	PYCLASS_DEF_INTERFACE(CPyScaleBy)
	public:
		CPyScaleBy();
		CC_ACTION_PYTYPE_MAPPING(CPyScaleBy);
	};
		
	class CPyBlink : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyBlink)
	public:
		CPyBlink();
		CC_ACTION_PYTYPE_MAPPING(CPyBlink);
	};
			
	class CPyFadeIn : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyFadeIn)
	public:
		CPyFadeIn();
		CC_ACTION_PYTYPE_MAPPING(CPyFadeIn);
	};
		
	class CPyFadeOut : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyFadeOut)
	public:
		CPyFadeOut();
		CC_ACTION_PYTYPE_MAPPING(CPyFadeOut);
	};
		
	class CPyFadeTo : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyFadeTo)
	public:
		CPyFadeTo();
		CC_ACTION_PYTYPE_MAPPING(CPyFadeTo);
	};
		
	class CPyTintTo : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyTintTo)
	public:
		CPyTintTo();
		CC_ACTION_PYTYPE_MAPPING(CPyTintTo);
	};
		
	class CPyTintBy : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyTintBy)
	public:
		CPyTintBy();
		CC_ACTION_PYTYPE_MAPPING(CPyTintBy);
	};

	class CPyDelayTime : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyDelayTime)
	public:
		CPyDelayTime();
		CC_ACTION_PYTYPE_MAPPING(CPyDelayTime);
	};

	class CPyReverseTime : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyReverseTime)
	public:
		CPyReverseTime();
		CC_ACTION_PYTYPE_MAPPING(CPyReverseTime);
	};

	class CPyAnimate : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyAnimate)
	public:
		CPyAnimate();
		CC_ACTION_PYTYPE_MAPPING(CPyAnimate);
		PYCLASS_GETSET_MAPPING_DEF(CPyAnimate, Animation);
	};

	class CPyTargetedAction : public CPyActionInterval
	{
	PYCLASS_DEF_INTERFACE(CPyTargetedAction)
	public:
		CPyTargetedAction();
		CC_ACTION_PYTYPE_MAPPING(CPyTargetedAction);
		PYCLASS_GETSET_MAPPING_DEF(CPyTargetedAction, ForcedTarget);
	};

	///////////////////////////////////////////////////////////////
	class CPyActionInstant : public CPyFiniteTimeAction
	{
	PYCLASS_DEF_INTERFACE(CPyActionInstant)
	public:
		CPyActionInstant();
		CC_ACTION_PYTYPE_MAPPING(CPyActionInstant);
	};
	class CPyShow : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyShow)
	public:
		CPyShow();
		CC_ACTION_PYTYPE_MAPPING(CPyShow);
	};
	class CPyHide : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyHide)
	public:
		CPyHide();
		CC_ACTION_PYTYPE_MAPPING(CPyHide);
	};
	class CPyToggleVisibility : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyToggleVisibility)
	public:
		CPyToggleVisibility();
		CC_ACTION_PYTYPE_MAPPING(CPyToggleVisibility);
	};
	class CPyRemoveSelf : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyRemoveSelf)
	public:
		CPyRemoveSelf();
		CC_ACTION_PYTYPE_MAPPING(CPyRemoveSelf);
	};
	class CPyFlipX : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyFlipX)
	public:
		CPyFlipX();
		CC_ACTION_PYTYPE_MAPPING(CPyFlipX);
	};
	class CPyFlipY : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyFlipY)
	public:
		CPyFlipY();
		CC_ACTION_PYTYPE_MAPPING(CPyFlipY);
	};
	class CPyPlace : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyPlace)
	public:
		CPyPlace();
		CC_ACTION_PYTYPE_MAPPING(CPyPlace);
	};

	CC_OBJECT_WRAPPER_DEF(CCCallFuncND)

	class CPyCallFunc : public CPyActionInstant
	{
	PYCLASS_DEF_INTERFACE(CPyCallFunc)
	public:
		CPyCallFunc();
		void On_SEL_CallFuncND(cocos2d::CCObject* obj = NULL, void* p = NULL);
		void DeleteDelegate();
		CC_ACTION_PYTYPE_MAPPING(CPyCallFunc);

		LPY_CALLFUNC_CB_INFO GetCallInfo(){ return m_info; }
		void SetCallInfo( LPY_CALLFUNC_CB_INFO info ){ m_info = info; }
	private:
		LPY_CALLFUNC_CB_INFO m_info;
	};
	///////////////////////////////////////////////////////////////

	class CPyActionManager : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyActionManager)
	public:
	};

	class CPyAnimation : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyAnimation)
	public:
		CPyAnimation();
		PYCLASS_METHOD_DEF(CPyAnimation, addSpriteFrame);
		PYCLASS_METHOD_DEF(CPyAnimation, addSpriteFrameWithFileName);
		PYCLASS_METHOD_DEF(CPyAnimation, addSpriteFrameWithTexture);
		PYCLASS_METHOD_KW_DEF(CPyAnimation, initWithSpriteFrames);
		PYCLASS_METHOD_DEF(CPyAnimation, initWithAnimationFrames);
		PYCLASS_GET_DEF(CPyAnimation, TotalDelayUnits);
		PYCLASS_GETSET_MAPPING_DEF(CPyAnimation, DelayPerUnit);
		PYCLASS_GET_DEF(CPyAnimation, Duration);
		PYCLASS_GETSET_MAPPING_DEF(CPyAnimation, Frames);
		PYCLASS_GETSET_MAPPING_DEF(CPyAnimation, RestoreOriginalFrame);
		PYCLASS_GETSET_MAPPING_DEF(CPyAnimation, Loops);
	};
NS_CCPY_END

#endif